//
//  MQMusicCell.m
//  MQ
//
//  Created by lanou on 15/10/28.
//  Copyright © 2015年 徐永祥. All rights reserved.
//

#import "MQMusicCell.h"
#import <UIImageView+WebCache.h>
@implementation MQMusicCell
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        _myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, (SCREEN_WIDTH - 30) / 2, (SCREEN_WIDTH - 30) / 2)];
        [self.contentView addSubview:_myImageView];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, (SCREEN_WIDTH - 30) / 2, (SCREEN_WIDTH - 30) / 2, 30)];
        _titleLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_titleLabel];
        
        _tingImageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 30) / 3 - 20, 8, 18, 18)];
        _tingImageView.image = [UIImage imageNamed:@"erji"];
        [self.contentView addSubview:_tingImageView];
        
        _listenLabel = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 30) / 3, 5, 80, 30)];
        _listenLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_listenLabel];
    }
    return self;
}
- (void)configureCellWithModel:(MQMusicModel *)model{
    [_myImageView sd_setImageWithURL:[NSURL URLWithString:model.pic_url]];
    _titleLabel.text = model.songlistname;
    _listenLabel.text = [NSString stringWithFormat:@"%ld", model.listen_count];
}
@end
